# import datetime

# now = datetime.datetime.now()
# days = datetime.timedelta(days=1)
# yesterday = now - days
# yesterday_formated = yesterday.strftime('%Y-%m-%d')
# print(yesterday_formated)

# import datetime

# today = datetime.date.today()
# days = datetime.timedelta(days=1)
# yesterday = today - days
# print(yesterday, type(yesterday))

import datetime

t1 = '2020-12-31'
t2 = '20201231'
t3 = '201231'
t4 = '2020-12-31 23:59:59'
t5 = 1609430399

s1 = datetime.datetime.strptime(t1, '%Y-%m-%d')
s2 = datetime.datetime.strptime(t2, '%Y%m%d')
s3 = datetime.datetime.strptime(t3, '%y%m%d')
s4 = datetime.datetime.strptime(t4, '%Y-%m-%d %H:%M:%S')
x = s4.strftime('%Y-%m-%d')
y = datetime.datetime.fromtimestamp(t5)
print(s1, s2, s3, s4)
print(x)
print(y)
